<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <channel>
        <title>Dynamisys</title> 
        <link>https://dynamisys.co.uk</link> 
        <description>RSS feeds for Dynamisys</description> 
        <ttl>60</ttl> <item>
    <comments>https://dynamisys.co.uk/Articles-Downloads/Articles/ID/168/SQL-Server--Prevent-overbooking-of-a-course-concert-event#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=168</wfw:commentRss> 
    <trackback:ping>https://dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=168&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>SQL Server - Prevent overbooking of a course, concert, event...</title> 
    <link>https://dynamisys.co.uk/Articles-Downloads/Articles/ID/168/SQL-Server--Prevent-overbooking-of-a-course-concert-event</link> 
    <description>This solves the situation of a link table (Bookings) that links CourseEvent and Student.

Problem&nbsp;- There are a limited number of places available so we need to prevent inserting more than &#39;@MaxBookingsAllowed&#39; rows into the bookings table for a specific IdCourseEvent

&nbsp;

In SQL Server I suggest locking hints. Other databases have similar functionality. My scenario is booking students onto course events...

begin transaction

declare @currentBookings int = (select count(*) from bookings with (serializable, updlock) where IdCourseEvent = @IdCourseEvent)

if @currentBookings &lt; @MaxBookingsAllowed

begin

insert bookings(idStudent, IdCourseEvent) values(@IdStudent, @IdCourseEvent)

set @RowsAffected = @@rowcount

end

commit transaction&nbsp;

The updlock hint instructs SQL Server to take locks as if updating the rows. That blocks other transactions from reading the same rows as this one. Without it two of these can deadlock against each other. T1 reads and discovers it&#39;s safe to insert.&nbsp; T2 also reads and finds it safe to insert.&nbsp; T1 (say) now tries to insert, but can&#39;t because of the locks T2 holds.&nbsp; T2 dsicovers the same

The serializable hint instructs SQL Server to take range locks that prevent another transaction inserting rows that would qualify for the where clause. It also causes any read locks to extend to the end of the transaction. (I suspect that serializable might not be strictly required here, but it gives me confidence!)
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Mon, 29 Jun 2026 12:46:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:168</guid> 
    
</item>
<item>
    <comments>https://dynamisys.co.uk/Articles-Downloads/Articles/ID/99/Getting-Git-to-work-with-BitVise-server#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=99</wfw:commentRss> 
    <trackback:ping>https://dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=99&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Getting Git to work with BitVise server</title> 
    <link>https://dynamisys.co.uk/Articles-Downloads/Articles/ID/99/Getting-Git-to-work-with-BitVise-server</link> 
    <description>Using BitVise Server 7.38 and Git for Windows 2.15.1 I was plagued with messages &amp;#39;blah&amp;#39; does not&amp;nbsp;seem to be a repository.

I found that I had to use the gitcmdhelper.sh trick - mentioned here but this is not the prime source of it (https://github.com/PowerShell/Win32-OpenSSH/issues/98). Also useful help in&amp;nbsp;https://holyhoehle.wordpress.com/2011/01/26/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd/ and in&amp;nbsp;https://holyhoehle.wordpress.com/2011/08/05/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd-update/

Then I got complaints a la /usr/bin/bash githelper.sh file or directory not found.&amp;nbsp; I fixed it by fully qualifying the file something like c:\Program Files\Git\bin\githelper.sh.&amp;nbsp; I didn&amp;#39;t need the full qualification on my previous install of BitVise/Git.&amp;nbsp; They are older versions.

I also had to add Git\bin and Git\mingw\libexec\git-core or somthing like it to get the git-upload-pack et al commands available.
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Sun, 14 Jan 2018 01:09:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:99</guid> 
    
</item>

    </channel>
</rss>